package test.y2020;

import cn.hutool.core.lang.Console;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2020/7/24 18:13
 */
public class July4 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("not");
        list.add("add");
        list.add("dog");
        list.add("acid");
        list.add("add");
        list.add("elf");
        list.add("gap");
        list.add("cat");
        list.add("rat");
        List<String> a = list.stream().filter(i -> StrUtil.isNotBlank(i)).filter(i -> i.contains("a")).map(i ->
                i = new StringBuffer(i).reverse().toString()
        ).distinct().limit(3).collect(Collectors.toList());
        Console.error(JSON.toJSONString(a));
    }
}
